package com.tarena.lbs.basic.web.utils;

import com.tarena.lbs.common.passport.principle.UserPrinciple;

public class AuthenticationContextUtils {
    private static ThreadLocal<UserPrinciple> threadLocal = new ThreadLocal<>();

    public static void set(UserPrinciple userPrinciple){
        threadLocal.set(userPrinciple);
    }

    public static UserPrinciple get(){
        return threadLocal.get();
    }

    public static void clear(){
        threadLocal.remove();
    }
}
